﻿@model IEnumerable<Treinamento2015_01.Models.ProductViewModel>

@{
    ViewBag.Title = "Index";
}
@Styles.Render("~/Content/Productcss.css")
<h2>Index</h2>

<p>
    @Html.ActionLink(Treinamento2015_01.Resources.Product.ResourceProduct.LinkCreateTitle, "Create")
</p>
<table class="table">
    <tr>
        <th>
            @Html.DisplayNameFor(model => model.Name)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.ProductType)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.IsActive)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Manufacturer)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Price)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.CreationDate)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.ModificationDate)
        </th>
        <th></th>
    </tr>

    @foreach (var item in Model)
    {
        <tr>
            <td>
                 @Html.DisplayFor(modelItem => item.Name)
            </td>
            <td>
                <img class="TypeImage" src="@Url.Content(item.ProductType.ImageUrl)">@Html.ValueFor(model => item.ProductType.Name)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.IsActive)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Manufacturer.Name)
            </td>
            <th>
                @Html.DisplayFor(modelItem => item.Price)
            </th>
            <td>
                @Html.DisplayFor(modelItem => item.CreationDate)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.ModificationDate)
            </td>
            <td>
                @Html.ActionLink(Treinamento2015_01.Resources.General.Resource.Edit, "Edit", new { id = item.Id }) |
                @Html.ActionLink(Treinamento2015_01.Resources.General.Resource.Details, "Details", new { id = item.Id }) |
                @Html.ActionLink(Treinamento2015_01.Resources.General.Resource.Delete, "Delete", new { id = item.Id })
            </td>
        </tr>
    }

</table>
